package com.miao.admin.controller;


import com.miao.common.entity.R;
import com.miao.common.entity.pojo.Carouse;
import com.miao.admin.service.AdminCarouseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 首页轮播图信息表(Carouse)表控制层
 *
 * @author MiaoWenQing
 * @since 2021-02-19 17:50:21
 */
@RestController
@RequestMapping("common/carouse")
public class AdminCarouseController {
    /**
     * 服务对象
     */
    @Resource
    private AdminCarouseService adminCarouseService;



    @GetMapping("/all")
    public R carouseList(){
        return R.ok(this.adminCarouseService.list());
    }

    @PostMapping("/edit")
    public R editCarouseList( @RequestBody Carouse carouse){
        if (this.adminCarouseService.saveOrUpdate(carouse)) {
            return R.ok();
        }
        return R.error();
    }





}
